<?php

class News extends Duplo {

    private $tplNewsElement = 'newsElement.tpl';

    public function getDir() {
        return DIR_MODULES.__CLASS__.'/';
    }

    public function defaultAction () {
        $tmpl = new Template($this->getDir().$this->tplNewsElement);
        $tmpl->bind('title', 'New title');
        $tmpl->bind('text', 'This is news blah-blah. The use keyword must be declared in the outermost scope of a file (the global scope) or inside namespace declarations. This is because the importing is done at compile time and not runtime, so it cannot be block scoped. The following example will show an illegal use of the use keyword.');
        $tmpl->bind('date', '2011-10-12 14:01:51');
        return $tmpl->fetch();
    }

    public function errorAction() {
        return $this->defaultAction ();
    }

}
